package com.yincheng.oes.business.model.entity;

import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author: yangsy
 * @Contact: 446948434@qq.com
 * @Date: 2021/8/28 23:05
 * @Version: 1.0
 * @Description:
 */
public class ExportStudentPaperQuestionsDO {

    /**
     * 题目id
     */
    private Integer quesId;

    /**
     * 答卷id
     */
    private String paperResultId;

    /**
     * 主题干 （由于前端存储时，映射错误，导致数据库中的题目的主题干和分题干颠倒了）
     * TODO 后期需要整体调整过来
     */
    private String stem;

    /**
     * 分题干
     */
    private String branch;

    /**
     * 选项A
     */
    private String optionA;

    /**
     * 选项B
     */
    private String optionB;

    /**
     * 选项C
     */
    private String optionC;

    /**
     * 选项D
     */
    private String optionD;
    /**
     * 选项E
     */
    private String optionE;
    /**
     * 选项F
     */
    private String optionF;

    /**
     * 参考答案
     */
    private String answer;

    /**
     * 我的答案
     */
    private String myAnswer;

    /**
     * 答案详解
     */
    private String analysis;

    /**
     * 题目序号，从0开始
     */
    private int quesOrder;

    /**
     * 是否正确，0：否，1：是
     */
    private String correctFlag;

    private List<String> optionTitles = new ArrayList<>();

    public String getCorrectFlag() {
        return correctFlag;
    }

    public void setCorrectFlag(String correctFlag) {
        this.correctFlag = correctFlag;
    }

    public Integer getQuesId() {
        return quesId;
    }

    public void setQuesId(Integer quesId) {
        this.quesId = quesId;
    }

    public String getPaperResultId() {
        return paperResultId;
    }

    public void setPaperResultId(String paperResultId) {
        this.paperResultId = paperResultId;
    }

    public String getStem() {
        return stem;
    }

    public void setStem(String stem) {
        this.stem = stem;
    }

    public String getBranch() {
        return branch;
    }

    public void setBranch(String branch) {
        this.branch = branch;
    }

    public String getOptionA() {
        return optionA;
    }

    public void setOptionA(String optionA) {
        this.optionA = optionA;
    }

    public String getOptionB() {
        return optionB;
    }

    public void setOptionB(String optionB) {
        this.optionB = optionB;
    }

    public String getOptionC() {
        return optionC;
    }

    public void setOptionC(String optionC) {
        this.optionC = optionC;
    }

    public String getOptionD() {
        return optionD;
    }

    public void setOptionD(String optionD) {
        this.optionD = optionD;
    }

    public String getOptionE() {
        return optionE;
    }

    public void setOptionE(String optionE) {
        this.optionE = optionE;
    }

    public String getOptionF() {
        return optionF;
    }

    public void setOptionF(String optionF) {
        this.optionF = optionF;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    public String getMyAnswer() {
        return myAnswer;
    }

    public void setMyAnswer(String myAnswer) {
        this.myAnswer = myAnswer;
    }

    public String getAnalysis() {
        return analysis;
    }

    public void setAnalysis(String analysis) {
        this.analysis = analysis;
    }

    public int getQuesOrder() {
        return quesOrder;
    }

    public void setQuesOrder(int quesOrder) {
        this.quesOrder = quesOrder;
    }

    public List<String> getOptions() {
        List<String> options = new ArrayList<>();
        if (StringUtils.isNotEmpty(optionA)) {
            options.add(optionA);
            optionTitles.add("A");
        }
        if (StringUtils.isNotEmpty(optionB)) {
            options.add(optionB);
            optionTitles.add("B");
        }
        if (StringUtils.isNotEmpty(optionC)) {
            options.add(optionC);
            optionTitles.add("C");
        }
        if (StringUtils.isNotEmpty(optionD)) {
            options.add(optionD);
            optionTitles.add("D");
        }
        if (StringUtils.isNotEmpty(optionE)) {
            options.add(optionE);
            optionTitles.add("E");
        }
        if (StringUtils.isNotEmpty(optionF)) {
            options.add(optionF);
            optionTitles.add("F");
        }
        return options;
    }

    public List<String> getOptionTitles() {
        return optionTitles;
    }
}
